package com.rhaggarty.blackjack.game;

import java.math.BigDecimal;

/**
 * The immutable result of a {@link GameAction}.  
 * 
 * A result is made up of a {@link GameStatus} and, potentially, a payout.
 * 
 * @author Ryan Haggarty (ryanmh@gmail.com)
 */
public final class GameResult {

    public static final GameResult PENDING = new GameResult(GameStatus.PENDING);

    private final GameStatus status;
    
    private final BigDecimal winAmount;
    
    public GameResult(final GameStatus status) {
        this(status, BigDecimal.ZERO);
    }

    public GameResult(final GameStatus status, final BigDecimal winAmount) {
        this.status = status;
        this.winAmount = winAmount;
    }
    
    public GameStatus getStatus() {
        return status;
    }
    
    public BigDecimal getWinAmount() {
        return winAmount;
    }
    
    @Override
    public String toString() {
        return status + " - winAmount=" + winAmount;
    }
}
